/**
 * getElementsByClassName
 *
 * Written by Jonathan Snook, http://www.snook.ca/jonathan;
 * Add-ons by Robert Nyman, http://www.robertnyman.com
 *
 * Modified slightly - smithd.
 */

var Utils = Utils || {};

Utils.EventHelper = {};

Utils.EventHelper.getElementsByClassName = function(oElm, strTagName, strClassName){
    var i;
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrElements_length = arrElements.length;
    var arrReturnElements = [];
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(i=0; i<arrElements_length; i++){
        oElement = arrElements[i];
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements);
};